package com.emmmya.ocs.config.autoRunner.task;

import com.emmmya.ocs.common.base.AbstractDefaultTask;
import com.emmmya.ocs.config.SystemConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @description: 初始化系统参数
 * @author: 咕噜肉IT小店-黑医
 * @createDate: 2020-12-22
 * @version: 1.0
 */
@Component
public class SelfAutoStartTaskManagementTask extends AbstractDefaultTask {
    @Autowired
    SystemConfig systemConfig;

    public SelfAutoStartTaskManagementTask(){
        setTaskName("系统配置初始化");
        setOrder(3);
    }

    @Override
    public boolean run() {
        setResultFlag(true);
       // systemConfig.setLog(systemConfig.isLog());
       // setMessage("设置系统日志为:"+(systemConfig.isLog()?"":"不")+"开启");
        SystemConfig.log = true;
        setMessage("设置系统日志为:"+(SystemConfig.log ?"":"不")+"开启");
        return true;
    }
}
